<template>
  <div class="app-header">
    <img src="/images/common/logo.png" alt="" class="logo">

    <div class="list">
      <div
        class="list-item"
        :class="{ active: item.key === (route?.path || '/') }"
        v-for="item in RouterList"
        :key="item.key">
        <NuxtLink :to="item.key">{{ item.label }}</NuxtLink>
      </div>
    </div>

    <div class="phone-box">400-888-6161</div>
  </div>
</template>

<script setup>
const route = useRoute()
</script>

<style lang="less" scoped>
.app-header {
  width: 12rem;
  height: 0.75rem;
  background: #FFFFFF;
  border-radius: .38rem;
  padding: 0 .3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;

  .list {
    display: flex;
    height: 100%;
    line-height: .75rem;

    .list-item {
      font-size: .16rem;
      font-weight: 500;
      padding: 0 .24rem;

      &.active {
        position: relative;

        &:after {
          content: '';
          position: absolute;
          height: 0.05rem;
          width: 100%;
          background: #C48674;
          left: 0;
          bottom: 0;
        }
      }

      &:last-child {
        margin-right: 0;
      }
    }
  }

  .logo {
    width: 1.68rem;
    height: .48rem;
  }

  .phone-box {
    width: 1.55rem;
    height: .4rem;
    background: url('/images/common/phone-icon.png') no-repeat;
    background-size: 100% 100%;
    color: #333333;
    font-size: .18rem;
    line-height: .4rem;
    text-align: right;
  }
}
</style>
